/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.context;

import com.controller.ConceptoPagoPersonalController;
import com.controller.DataXmlCampoController;
import com.controller.DataXmlMarcoController;
import com.controller.LogXmlCargadoController;
import com.controller.ConglomeradoPersonalController;
import com.controller.ConglomeradoPersonalResumenController;
import com.controller.MonitoreoTransferenciaController;
import com.controller.PeriodoController;
import com.controller.PersonalController;
import com.controller.ProgramacionPeriodoController;
import com.controller.ReporteTransferenciaController;
import com.controller.UbigeoController;
import com.controller.UsuarioController;

public class ControllerContext {
        
    private final UsuarioController usuarioController = new UsuarioController();
    private final DataXmlCampoController dataXmlCampoController = new DataXmlCampoController();
    private final DataXmlMarcoController dataXmlMarcoController = new DataXmlMarcoController();
    private final ReporteTransferenciaController reporteTransferenciaController = new ReporteTransferenciaController();
    private final MonitoreoTransferenciaController monitoreoTransferenciaController = new MonitoreoTransferenciaController();
    private final LogXmlCargadoController logXmlCargadoController = new LogXmlCargadoController();
    private final PersonalController personalController = new PersonalController();    
    private final ConglomeradoPersonalController conglomeradoPersonalController = new ConglomeradoPersonalController();    
    private final ConglomeradoPersonalResumenController conglomeradoPersonalResumenController = new ConglomeradoPersonalResumenController();    
    private final UbigeoController ubigeoController = new UbigeoController();    
    private final ProgramacionPeriodoController programacionPeriodoController = new ProgramacionPeriodoController();    
    private final PeriodoController periodoController = new PeriodoController();   
    private final ConceptoPagoPersonalController conceptoPagoPersonalController = new ConceptoPagoPersonalController();   
    
    
    private AppContext appContext;
        
    protected ControllerContext() {        
        
    }
    
    public void setAppContext(AppContext appContext) {
        this.appContext = appContext;
    }
        
    public void inicializar() {        
        ModelContext modelContext = appContext.getModelContext();
        
        usuarioController.setService(modelContext.getUsuarioService());       
        
        dataXmlCampoController.setService(modelContext.getDataXmlCampoService());
        dataXmlCampoController.setUsuarioController(usuarioController);
        dataXmlCampoController.setMonitoreoTransferenciaController(monitoreoTransferenciaController);
        
        dataXmlMarcoController.setService(modelContext.getDataXmlMarcoService());
        dataXmlMarcoController.setUsuarioController(usuarioController);
        
        reporteTransferenciaController.setService(modelContext.getReporteTransferenciaService());
        
        monitoreoTransferenciaController.setService(modelContext.getMonitoreoTransferenciaService());
        
        logXmlCargadoController.setService(modelContext.getLogXmlCargadoService());
        
        personalController.setService(modelContext.getPersonalService());
        personalController.setLoggerErrores(appContext.getLoggerContext().getLoggerErrores());
       
        conglomeradoPersonalController.setService(modelContext.getConglomeradoPersonalService());
        conglomeradoPersonalResumenController.setService(modelContext.getConglomeradoPersonalResumenService());
        
        ubigeoController.setService(modelContext.getUbigeoService());
        
        programacionPeriodoController.setService(modelContext.getProgramacionPeriodoService());
        
        periodoController.setService(modelContext.getPeriodoService());
        
        conceptoPagoPersonalController.setService(modelContext.getConceptoPagoPersonalService());
    }

    public UsuarioController getUsuarioController() {
        return usuarioController;
    }

    public DataXmlCampoController getDataXmlCampoController() {
        return dataXmlCampoController;
    }

    public DataXmlMarcoController getDataXmlMarcoController() {
        return dataXmlMarcoController;
    }

    public ReporteTransferenciaController getReporteTransferenciaController() {
        return reporteTransferenciaController;
    }   
    
    public MonitoreoTransferenciaController getMonitoreoTransferenciaController() {
        return monitoreoTransferenciaController;
    }

    
    //private ModelContext getModelContext() {
    //    return modelContext;
    //}

    public LogXmlCargadoController getLogXmlCargadoController() {
        return logXmlCargadoController;
    }

    public ConglomeradoPersonalController getConglomeradoPersonalController() {
        return conglomeradoPersonalController;
    }

    public PersonalController getPersonalController() {
        return personalController;
    }

    public UbigeoController getUbigeoController() {
        return ubigeoController;
    }

    public ProgramacionPeriodoController getProgramacionPeriodoController() {
        return programacionPeriodoController;
    }

    public ConglomeradoPersonalResumenController getConglomeradoPersonalResumenController() {
        return conglomeradoPersonalResumenController;
    }

    public PeriodoController getPeriodoController() {
        return periodoController;
    }

    public ConceptoPagoPersonalController getConceptoPagoPersonalController() {
        return conceptoPagoPersonalController;
    }
    
    
    
}
